﻿@model IEnumerable<KRM.Core.tblEmail>

@{
    ViewBag.Title = "New Emails";
    Layout = "~/Views/Shared/_HRLayout.cshtml";
    var db = new KRM.Core.KRMEntities();
}
@section Scripts{
            <script src="/js/mail.js"></script>
            <script src="/hr/js/plugins/ckeditor/ckeditor.js"></script>

}
    <div class="portlet alert">
        <div class="portlet-title">
            <div class="caption"><i class="icon-envelope-alt" style="font-size: 16px"></i> New Emails</div>
        </div>
        @Html.Partial("Partial/_MessageResult")
        <form class="form-horizontal" id="frFilterEmail" action="/EmailTicket/Index" method="GET" style="margin-bottom: 5px">
            <div class="row">
                <label class="control-label col-md-1">Status:</label>
                <div class="col-md-3"> @Html.DropDownList("FilterStatusID",null,new {@onchange="FilterEmail()",@class="form-control"})
            </div></div>
        </form>
        <table class="table table-bordered table-fix tbl-selected table-striped table-hover dataTable" style="background-color:#F8F8F8;">
            <thead>
                <tr>
                    <th style="width:250px;">Date</th>
                    <th>From</th>
                    <th>Subject</th>
                    <th style="width:150px;">Status</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                    <tr onclick="maildetail('@item.EmailID')" style="cursor: pointer;">
                        <td>@item.Date</td>
                        <td>@item.From</td>
                        <td>@item.Subject</td>
                        <td>
                            @if(@item != null && @item.StatusID > 0)
                            {
                                @db.tblEmailStatus.Find(@item.StatusID).Status
                            }  
                        </td>
                    </tr>
                }
            </tbody>
        </table>
        <form action="/EmailTicket/EmailDetails" method="POST" class="row-fluid fr-maildetail">            
        </form>
    </div>